#ifndef CHECKVIEW_H
#define CHECKVIEW_H

#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QString>

class EmployeeManager;

class CheckView : public QWidget
{
    Q_OBJECT
public:
    explicit CheckView(EmployeeManager *manager, const QString &empId, QWidget *parent = nullptr);
    ~CheckView();

private slots:
    // 签到按钮点击事件
    void onCheckInButtonClicked();

    // 签退按钮点击事件
    void onCheckOutButtonClicked();

    // 更新打卡状态
    void updateCheckStatus(const QString &status);

    // 刷新打卡记录
    void refreshAttendanceRecord();

private:
    // 初始化UI
    void initUI();

    EmployeeManager *m_employeeManager;
    QString m_empId;

    QPushButton *m_checkInButton;
    QPushButton *m_checkOutButton;
    QLabel *m_statusLabel;
    QLabel *m_checkInTimeLabel;
    QLabel *m_checkOutTimeLabel;
    QLabel *m_attendanceStatusLabel;

};

#endif // CHECKVIEW_H
